namespace Core.Implementation
{
	using System.Diagnostics.Contracts;
	using Infrastructure;
	using Microsoft.Practices.Unity;

	internal class NHibernateDomainSessionFactory : IDomainSessionFactory
	{
		public NHibernateDomainSessionFactory(IUnityContainer container)
		{
			CodeContract.Requires(container != null);
			this.Container = container;
		}

		public IUnityContainer Container
		{
			get;
			private set;
		}

		public DomainSession Create()
		{
			return this.Container.Resolve<DomainSession>();
		}			
	}
}